package MultInstance;

import java.util.Random;

public class MultInstance {

	private static MultInstance[] multInstances = new MultInstance[4];
	private static Random random = new Random();
	private int id;
	
	
	static{
		for(int i = 0 ;i< 4;i++)
			multInstances[i] = new MultInstance(i);
	}
	
	private MultInstance(int id){
		this.id = id;
	}
	
	public static MultInstance getInstance(){
		int idx = random.nextInt(4);
		return multInstances[idx];
	}

	public int getId(){
		return this.id;
	}
}
